﻿#pragma once
#define LK_WINDOWS_UI_EMPTYWINDOW_
namespace LK
{
	namespace Windows
	{
		namespace UI
		{
			/**
			@brief 表示一个空的窗体（无内容）*/
			class IEmptyWindow :public IControl
			{
			public:
				IEmptyWindow(const IEmptyWindow&) { Throw <PNotSupportException>(); }
				BMETHODS(PEmptyWindow,IEmptyWindow)
				//默认的按钮过程处理函数指针
				static LONG_PTR pfun;
				IEmptyWindow(HWND hParent=NULL)
					:IControl()
				{
					hMaptc().Lock();//传递指针
					staticPointer = this;
					SetHandle(Create(L"EmptyWindow", Rect(0, 0, 160, 60), Design().lpszClassName, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_CHILD | WS_VISIBLE, 0, hParent, NULL));
					hMaptc().UnLock();
				}

				//重写默认消息处理
				virtual LRESULT DefWndProc(MSG& message);

				//设计
				static WNDCLASSEXW& Design();

				//重写消息循环（可重写）
				virtual void WndProc(MSG& ){}
			};
			/**
			@brief 表示空窗体控件的代理*/
			class PEmptyWindow :public PLabel
			{
			public:
				PMETHODS(PEmptyWindow, IEmptyWindow);
				//构造为子窗体
				PEmptyWindow(PControl const &c) :PLabel(new IEmptyWindow(c.Ptr()->GetHandle())){}
			};
		}
	}
}
